package ControlLayer;
import ModelLayer.*;
import java.util.ArrayList;
/**
**This Class contols everything to do with the model classes Loan and LoanContainer
*/
public class LoanCtr
{
    private LoanContainer loanList;

    public LoanCtr()
    {
        loanList = LoanContainer.getInstance();
    } 
    
    //Creates a new Loan object and adds it to loanList
    public void createLoan(String date, int periode, boolean status, long id, long personId, long dvdId, long sampleSerial)
    {
        Loan newLoan = new Loan(date, periode, status, id, personId, dvdId, sampleSerial);
        loanList.addLoan(newLoan);
    }
    
    public void getLoan(long id)
    {
        loanList.getLoan(id);
    }
    
    public void returnLoan(long id)
    {
        loanList.deleteLoan(id);
    }
    
    public void updateLoan(String date, int periode, boolean status, long id)
    {
        loanList.updateLoan(date, periode, status, id);
    }
    
    public void listAllLoans()
    {
          loanList.listAllLoans();
    }
}
